#{extends 'mainFMPA.html' /}#{set title:'Modification de la Fiche' /}

<style type="text/css"> 
@import "../../../public/javascripts/jquery-ui-1.8.13.custom/css/ui-lightness/jquery-ui-1.8.13.custom.css";
</style>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js"></script>

<SCRIPT>
	$(function() {
		$( "#date" ).datepicker();
	});
</SCRIPT>

<h1>Modifier la Fiche</h1>
<div id="detail_fmpa">
#{form @modifFiche()}
    <p>
		<label for="CIS"><b>CIS :</b></label> 
		#{select 'cis', items:centres, id:'cis', valueProperty:'id', value:idCis}
		#{/select}
	</p>
	<p>
 	    <label for="CIS"><b>Origine de l'agent :</b></label> 
		#{select 'cis', items:centresbis, id:'centre', valueProperty:'id', value:idCis, onChange:'change()'}
		#{/select}
    </p>
    <p id="aModifier">
		<label for="agent"><b>Agent :</b></label>
		#{select 'agent', items:agents, id:'agent', valueProperty:'id', value:idAgent}
		#{/select}
	</p>
    <p>
        <label for="date"><b>Date :</b></label>
        <input type="text" name="date" id="date" value="${date}" />
    <p>
    <p>
 	    <label for="moyen"><b>Moyen :</b></label>
        #{select 'moyen', items:moyens, id:'moyen', valueProperty:'id', value:idMoyen}
        #{/select}
    </p>
    <p>
 	    <label for="duree"><b>Dur&eacute;e :</b></label>
        #{select 'duree', items:durees, id:'duree', valueProperty:'id', value:idDuree}
        #{/select}
    </p>
    <p>
 	    <label for="cadre"><b>Cadre d'utilisation :</b></label>
        #{select 'cadre', items:cadres, id:'cadre', valueProperty:'id', value:idCadre}
        #{/select}
    </p>
    <p>
 	    <label for="role"><b>Fonction :</b></label>
        #{select 'role', items:roles, id:'role', valueProperty:'id', value:idRole}
        #{/select}
    </p>
    <p>
	<input type="hidden" name="fiche" value=${fiche.id} >
    <p style="margin-top:30px">    
        <center><input style="float:left;" type="submit" value="Enregistrer les modifications" /></center>
        <center><input style="float:right;" type="button" onClick="self.location.href='@{FicheEchelles.listEchelle()}'" value="retour" /></center>
    </p>
#{/form}
</div>

<SCRIPT type="text/javascript">
	function change(){
	    var monCis=document.getElementById("centre").options[document.getElementById("centre").selectedIndex].value
	    $('#aModifier').load("/attraper/"+monCis)
	}
</SCRIPT>